import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import {nodePolyfills} from 'vite-plugin-node-polyfills'

// https://vite.dev/config/
export default defineConfig({
    plugins: [vue(), vueJsx(),
        nodePolyfills({include: ['buffer']})
    ],
    build: {
        outDir: 'D:\\Working\\pixiv-nginx\\nga_local'
    },
    define: {
        'process.env': {}
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:11451/',
                // rewrite: path => path.replace('/api', '')
            },
            '/static/res': {
                target: 'http://127.0.0.1:11451/',
                // rewrite: path => path.replace('/api', '')
            },
            '/static/attach': {
                target: 'http://127.0.0.1:11451/',
                // rewrite: path => path.replace('/api', '')
            },
            '/gitee': {
                target: 'http://127.0.0.1:11451/',
                // rewrite: path => path.replace('/api', '')
            },
            '/upload': {
                target: 'http://127.0.0.1:11451/',
                // rewrite: path => path.replace('/api', '')
            },

        }
    }
})
